home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
misc_pto
/
managr09
/
config40.bas
< prev
next >
Wrap
BASIC Source File
|
1991-12-29
|
5KB
|
226 lines
start:
'This is the routine for working with the CONFIG.SYS file in 40-column mode.
cls
print "View or Change Your CONFIG.SYS File."
print
print
print "On which drive is your CONFIG.SYS"
input "file";drive$
redrive:
drive$=drive$+"\"
if drive$="a:\" then file1$="a:\config.sys"
if drive$="A:\" then file1$="a:\config.sys"
if drive$="b:\" then file1$="b:\config.sys"
if drive$="B:\" then file1$="b:\config.sys"
if drive$="c:\" then file1$="c:\config.sys"
if drive$="C:\" then file1$="c:\config.sys"
if drive$="d:\" then file1$="d:\config.sys"
if drive$="D:\" then file1$="d:\config.sys"
if drive$="e:\" then file1$="e:\config.sys"
if drive$="E:\" then file1$="e:\config.sys"
if drive$="a:\" then file2$="a:\config.bak"
if drive$="A:\" then file2$="a:\config.bak"
if drive$="b:\" then file2$="b:\config.bak"
if drive$="B:\" then file2$="b:\config.bak"
if drive$="c:\" then file2$="c:\config.bak"
if drive$="C:\" then file2$="c:\config.bak"
if drive$="d:\" then file2$="d:\config.bak"
if drive$="D:\" then file2$="d:\config.bak"
if drive$="e:\" then file2$="e:\config.bak"
if drive$="E:\" then file2$="e:\config.bak"
confmenu:
cls
print "You have the following options:"
print
print
print "1- Just view the CONFIG.SYS file."
print
print "2- Add lines to the end of your file."
print
print "3- Create a new CONFIG.SYS file."
print
print "4- Return to the Main Options Menu."
print
print
print "Please press the number corresponding"
input "to your choice, and then press Enter. ",chngview$
if chngview$="1" then
cls
gosub seesys
goto confmenu
end if
if chngview$="2" then
cls
gosub appendln
gosub seesys
goto confmenu
end if
if chngview$="3" then
cls
goto newfilec
end if
if chngview$="4" then goto finish
goto confmenu
'This section creates a new CONFIG.SYS file.
newfilec:
cls
open file1$ for input as 1
open file2$ for output as 2
while not eof(1)
line input # 1, a$
print# 2, a$
wend
close # 1
close # 2
kill file1$
print
print
print "Your CONFIG.SYS file has been changed"
print "CONFIG.BAK in order to save it for"
print "future use. To use it later, your new"
print "CONFIG.SYS will have to be renamed to"
print "something else (for example, CONFIG.X)"
print
print
print
print "Press any key to continue. ";
gosub presskey
changagn:
cls
open file1$ for output as 1
print "How many files do you want?"
input "To quit, press Q and Enter. ",filenumb$
if filenumb$="q" or filenumb$="Q" then goto restorec
print# 1, "files=";filenumb$
print
print
print
input "How many buffers do you want";buffer$
print# 1, "buffers=";buffer$
devcagan:
print
print "Which device would you like to include"
input "(N for none)";device$
if device$="n" or device$="N" then goto nodevice
print# 1, "devices=";device$
print
input "Would you like to include more devices";incldmor$
if incldmor$="y" or incldmor$="Y" then goto devcagan
nodevice:
print
print "Do you want Break on or off (if not"
input "sure, type OFF)";breakyn$
if breakyn$="on" or breakyn$="ON" or breakyn$="oN" or breakyn$="On" then print# 1, "break=on"
close # 1
gosub seesys
print
print
print
print "If this is not O.K. AND you want to go"
print "back and change the file, press C and"
print "then press Enter."
print
print "To restore your original CONFIG.SYS"
print "file, press R and Enter."
print
print "If you're happy with it as is, type OK"
input "and Enter. ",change$
okdecide:
if change$="c" or change$="C" then goto changagn
if change$="r" or change$="R" then goto restorec
if change$="ok" or change$="OK" or change$="oK" or change$="Ok" then goto confmenu
print
input "You must choose between C, R, or OK. ",change$:goto okdecide
restorec:
cls
reset
kill file1$
open file2$ for input as 1
open file1$ for output as 2
while not eof(1)
line input # 1, a$
print# 2, a$
wend
reset
print "Your original CONFIG.SYS file has been"
print "restored."
print
print
print "Press any key to continue. ";
gosub presskey
goto confmenu
'This is the end of the routine for working with the CONFIG.SYS file in 40 c.
'Here is the routine for looking at the CONFIG.SYS file in 40-column mode.
seesys:
reset
cls
print "Here is your file:"
print
open file1$ for input as 1
while not eof(1)
line input # 1, a$
print a$
wend
close # 1
print
print
print "Press any key to continue. ";
gosub presskey
return
'This is the end for looking at the CONFIG.SYS file in 40-column mode.
'Here is the routine for adding lines to the end of CONFIG.SYS in 40-columns.
appendln:
reset
open file1$ for append as 1
appndagn:
print
input "Line to add (Q to quit)";appendln$
if appendln$="q" or appendln$="Q" then close # 1:return
print# 1, appendln$
goto appndagn:
'This is the end of the routine for adding lines to CONFIG.SYS in 40-columns
'Here is the routine for continuing when the user presses a key.
presskey:
wait:
a$=inkey$
if a$="" then goto wait
return
'This is the end of the routine for continuing when the user presses a key.
'Here is the routine for ending the program.
finish:
end